package com.atguigu.tingshu.order.rpc;

import com.atguigu.tingshu.common.result.Result;
import com.atguigu.tingshu.model.order.OrderInfo;
import com.atguigu.tingshu.order.service.OrderInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <a href="https://www.shallowrecall.top/">Recall`Blog</a></br>
 * <a href="https://github.com/ShallowRecall">GitHub</a>
 *
 * @author Recall
 * @createTime 2025/06/12 17:40
 **/
@RestController
@RequestMapping("/api/inner/orderinfo")
public class OrderInfoRpcController {

    @Autowired
    private OrderInfoService orderInfoService;


    @GetMapping("/getOrderInfoByOrderNo/{orderNo}/{userId}")
    Result<OrderInfo> getOrderInfoByOrderNo(@PathVariable(value = "orderNo") String orderNo, @PathVariable(value = "userId") Long userId) {
        OrderInfo orderInfo = orderInfoService.getOrderInfo(orderNo, userId);
        return Result.ok(orderInfo);
    }

}
